cmake_minimum_required(VERSION 3.16)

project(MYSQL LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


add_executable(MYSQL main.cpp)


# 添加包含目录--链接库--单个或多个
include_directories("C:/Program Files/MySQL/MySQL Server 8.0/include")
file(GLOB LIB_FILES "C:/Program Files/MySQL/MySQL Server 8.0/lib/*.lib")
# 遍历并链接找到的库文件
foreach(LIB_FILE ${LIB_FILES})
    target_link_libraries(MYSQL ${LIB_FILE})
    message(${LIB_FILE})
endforeach()



include(GNUInstallDirs)
install(TARGETS MYSQL
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
